<?php

namespace App\Enums\OpenShop\SiteLocation;

class SiteLocationAttachEnum
{
    //选址我的页面接口参数key定义
    const PERSONAL_KEY_UPLOADED               = 1;  //已上传
    const PERSONAL_KEY_PENDING_UPLOAD         = 2;  //累计待上传
    const PERSONAL_KEY_SITE_SUBMITTED         = 3;  //已提交
    const PERSONAL_KEY_SITE_APPROVED          = 4;  //审核通过
    const PERSONAL_KEY_SITE_RECOMMEND_ADDRESS = 5;  //推荐址
    const PERSONAL_KEY_SITE_OWN_ADDRESS       = 6;  //自带址
    const PERSONAL_KEY_HOUSE_SUBMITTED        = 7;  //已提交
    const PERSONAL_KEY_HOUSE_APPROVED         = 8;  //审核通过


    const PERSONAL_KEY_MAPPING = [
        self::PERSONAL_KEY_UPLOADED               => '`siteStatus` = 4 and `ctSubmitTime` > 0',
        self::PERSONAL_KEY_PENDING_UPLOAD         => '`siteStatus` = 21',
        self::PERSONAL_KEY_SITE_SUBMITTED         => '`source` = 0 and `siteStatus` > 1',
        self::PERSONAL_KEY_SITE_APPROVED          => '`source` = 0 and `siteStatus` in (4, 20, 21)',
        self::PERSONAL_KEY_SITE_RECOMMEND_ADDRESS => '`source` = 0 and `siteStatus` = 4 and `messageFrom` in (2, 6)',
        self::PERSONAL_KEY_SITE_OWN_ADDRESS       => '`source` = 0 and `siteStatus` = 4 and `messageFrom` in (1, 3, 7)',
        self::PERSONAL_KEY_HOUSE_SUBMITTED        => '((`source` = 1 and `clueStatus` in (3,4,5,6,11)) or (`source` = 0 and `bindId` > 0))',
        self::PERSONAL_KEY_HOUSE_APPROVED         => '((`source` = 1 and `clueStatus` = 5) or (`source` = 0 and `bindId` > 0))',
    ];


}
